package com.zw.stock_sell_storage.controller;

import com.zw.stock_sell_storage.dto.SaleStatisticDto;
import com.zw.stock_sell_storage.dto.SaleStatisticMonthDto;
import com.zw.stock_sell_storage.dto.ex.QueryTimeScopeDtoEx;
import com.zw.stock_sell_storage.service.ISaleStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/saleStatistic")
public class SaleStatisticController {
    @Autowired
    ISaleStatisticService iSaleStatisticService;

    @RequestMapping("/querySaleStatisticAsGoodsType")
    public List<SaleStatisticDto> querySaleStatisticAsGoodsType(@RequestBody QueryTimeScopeDtoEx queryTimeScopeDtoEx){
        return iSaleStatisticService.querySaleStatisticAsGoodsType(queryTimeScopeDtoEx);
    }

    @RequestMapping("/querySaleStatisticAsGoodsCode")
    public List<SaleStatisticDto> querySaleStatisticAsGoodsCode(@RequestBody QueryTimeScopeDtoEx queryTimeScopeDtoEx){
        return iSaleStatisticService.querySaleStatisticAsGoodsCode(queryTimeScopeDtoEx);
    }

    @RequestMapping("/querySaleStatisticYear")
    public List<String> querySaleStatisticYear(){
        return iSaleStatisticService.querySaleStatisticYear();
    }

    @RequestMapping("/querySaleStatisticAsGoodsTypeAndMonth")
    public List<SaleStatisticMonthDto> querySaleStatisticAsGoodsTypeAndMonth(String year){
        return iSaleStatisticService.querySaleStatisticAsGoodsTypeAndMonth(year);
    }
}
